package com.home.config;

import com.home.biz.JobConfigBiz;
import com.home.entity.JobConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
 * @author ：chenxf
 * @date ：Created in 2019/6/19 9:44
 * @description：全局变量
 * @modified By：
 * @version: $
 */

@Configuration
public class InitDataConfig implements  ServletContextAware {
    @Autowired
    private JobConfigBiz jobConfigBiz;

    public  static JobConfig jobConfig;
    @Autowired
    private JobConfigTask configTask;

    private static boolean fetchStatus=false;

    private static String veryCode="";
    private static String token="";

    private static String price="";

    private static String startTime="";

    private static String endTime="";

    private static Integer num=0;


    @Override
    public void setServletContext(ServletContext servletContext) {
       // jobConfig=jobConfigBiz.getConfig();
        //configTask.fetchTask();

    }


    public static boolean isFetchStatus() {
        return fetchStatus;
    }

    public static void setFetchStatus(boolean fetchStatus) {
        InitDataConfig.fetchStatus = fetchStatus;
    }

    public static String getVeryCode() {
        return veryCode;
    }

    public static void setVeryCode(String veryCode) {
        InitDataConfig.veryCode = veryCode;
    }

    public static String getToken() {
        return token;
    }

    public static void setToken(String token) {
        InitDataConfig.token = token;
    }

    public static String getStartTime() {
        return startTime;
    }

    public static void setStartTime(String startTime) {
        InitDataConfig.startTime = startTime;
    }

    public static String getEndTime() {
        return endTime;
    }

    public static void setEndTime(String endTime) {
        InitDataConfig.endTime = endTime;
    }

    public static String getPrice() {
        return price;
    }

    public static void setPrice(String price) {
        InitDataConfig.price = price;
    }

    public static Integer getNum() {
        return num;
    }

    public static void setNum(Integer num) {
        InitDataConfig.num = num;
    }
}
